package com.itheima.stock.api;

import com.itheima.stock.entity.StockBusiness;
import com.itheima.stock.response.PageResult;
import com.itheima.stock.response.ResponseResult;
import com.itheima.stock.vo.*;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.util.List;

/**
 * @author zby
 * @created 2024-06-23 16:29
 * @description
 */
@RequestMapping(path = "/api/quot")
public interface StockControllerAPI {
    @GetMapping(path = "/stock/updown")
    ResponseResult<StockUpDownVO<InfoVO>> stockUpDown();

    @GetMapping(path = "/stock/tradevol")
    ResponseResult< TradeAmtVO<OptionVO>> tradeAmt();

    /**
     *   导出股票数据到excel 文件
     * @param page  当前页码值
     * @param pageSize  页大小
     * @param response  响应对象（写一个文件会浏览器）
     */
    @GetMapping(path = "/stock/export")
    void export(@RequestParam("page") int page ,
                @RequestParam("pageSize") int pageSize,
                HttpServletResponse response) throws IOException;

    /**
     *  股票涨跌停统计
     */
    @GetMapping(path = "/stock/updown/count")
    ResponseResult<UpDownVO<OptionVO>> upDown();


    @GetMapping(path = "/stock/all")
    ResponseResult<PageResult<MoreVO>> more(@RequestParam("page") Integer page, @RequestParam("pageSize") Integer pageSize);


    @GetMapping(path = "/stock/increase")
    ResponseResult<List<IncreaseVO>> stockIncrease();

    /**
     *  板块指数数据
     */
    @GetMapping(path = "/sector/all")
    ResponseResult<List<SectorAllVO>> sectorAll();

    @GetMapping(path = "/index/all")
    ResponseResult<List<MarketIndexVO>> innerIndexAll();


    @GetMapping(path = "/stock/business/all")
    ResponseResult<List<StockBusiness>> getStockBusiness();



}
